package com.ccf.business.knowledge.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.common.utils.tool.UserUtil;
import com.service.mybatis.pojo.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.util.Date;


/**
 * 标注记录
 *
 * @author ccf
 * @date 2022-02-15 16:56:10
 */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@TableName("kcs_label_data")
@ApiModel(value="kcs_label_data对象", description="标注记录")
public class LabelData extends SuperEntity {
    private static final long serialVersionUID=1L;


    @ApiModelProperty(value = "任务关联")
    private String taskId;

    @ApiModelProperty(value = "资源关联")
    private String sourceId;

    @ApiModelProperty(value = "资源名称")
    private String fileName;

    public static final int ADDED = 0;
    public static final int TAGGING = 1;
    public static final int WAITING_AUDIT = 2;
    public static final int COMPLETED = 3;
    @ApiModelProperty(value = "状态（0已添加,1标注中,2待审核,3已完成）")
    private Integer status;

    @ApiModelProperty(value = "标注人")
    @JSONField(label = UserUtil.USER_LABEL)
    private String tager;

    @ApiModelProperty(value = "标注时间")
    private Date tagTime;

    @ApiModelProperty(value = "审核人")
    @JSONField(label = UserUtil.USER_LABEL)
    private String auditor;

    @ApiModelProperty(value = "审核时间")
    private Date auditTime;

    @ApiModelProperty(value = "创建人")
    @TableField(fill = FieldFill.INSERT)
    @JSONField(label = UserUtil.USER_LABEL)
    private String creator;

    @ApiModelProperty(value = "内容存文本")
    private String data;

    @ApiModelProperty(value = "文本转换后存储路径")
    private String path;

    @ApiModelProperty(value = "序号")
    private Integer serial;

    public Boolean isLabelStatus(){
        return status != null && status > TAGGING;
    }

    public Boolean isAuditStatus(){
        return status != null && status > WAITING_AUDIT;
    }


}
